<template>
  <div class="app-container home">
    <el-row :gutter="20" style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
      <el-col :sm="24" :lg="24">
        <el-card class="update-log">
          <div slot="header" class="clearfix">
            <span>数据统计</span>
          </div>
          <div class="body">
            <PanelGroup></PanelGroup>
          </div>
        </el-card>
       
      </el-col>
    </el-row>
    <el-divider />
    <el-row :gutter="20">
      <el-col :span="8">
        <el-card class="update-log">
          <div slot="header" class="clearfix">
            <span>商家账号统计</span>
          </div>
          <div class="body">
            <el-table
              :data="suppler"
              height="300"
              style="width: 100%">
              <el-table-column
                prop="nick_name"
                label="商家名称"
                >
              </el-table-column>
              <el-table-column
                prop="cot"
                label="账号数量"
               >
              </el-table-column>
            </el-table>
          </div>
        </el-card>
      </el-col>
      
      <el-col :span="8">
        <el-card class="update-log">
          <div slot="header" class="clearfix">
            <span>商家出号统计</span>
          </div>
          <div class="body">
            <el-table
              :data="subOrderList"
              height="300px"
              style="width: 100%">
              <el-table-column
                prop="supplyChannel"
                label="商家名称"
                >
              </el-table-column>
              <el-table-column
                prop="cot"
                label="出号数量"
               >
              </el-table-column>
            </el-table>
          </div>
        </el-card>
      </el-col>
      <el-col :span="8">
        <el-card class="update-log">
          <div slot="header" class="clearfix">
            <span>销售卖号统计</span>
          </div>
          <div class="body">
            <el-table
              :data="sellOrderList"
              height="300"
              style="width: 100%">
              <el-table-column
                prop="saleChannel"
                label="销售人"
                >
              </el-table-column>
              <el-table-column
                prop="cot"
                label="数量"
               >
              </el-table-column>
            </el-table>
          </div>
        </el-card>
      </el-col>
    </el-row>
    <el-row :gutter="20">
      <el-col :span="8">
        <el-card class="update-log">
          <div slot="header" class="clearfix">
            <span>游戏统计</span>
          </div>
          <div class="body">
            <el-table
              :data="games"
              height="300px"
              style="width: 100%">
              <el-table-column
                prop="type"
                label="游戏类型"
                >
              </el-table-column>
              <el-table-column
                prop="cot"
                label="账号数量"
               >
              </el-table-column>
            </el-table>
          </div>
        </el-card>
      </el-col>
      <el-col :span="8">
        <el-card class="update-log">
          <div slot="header" class="clearfix">
            <span>当前任务</span>
          </div>
          <div class="body">
            <el-table
              :data="jobs"
              height="300"
              style="width: 100%">
              <el-table-column
                prop="type"
                label="任务类型"
                >
              </el-table-column>
              <el-table-column
                prop="cot"
                label="数量"
               >
              </el-table-column>
            </el-table>
          </div>
        </el-card>
      </el-col>
    </el-row>
    <!-- <el-row :gutter="20">
      <el-col :span="24" >
        <el-card class="update-log">
          <div slot="header" class="clearfix">
            <span>常见问题</span>
          </div>
          <div class="body">
            <p>1、授权问题，联系微信：jiaoyitang88</p>
            <p>2、系统使用问题，联系微信：jiaoyitang88</p>
          </div>
        </el-card>
      </el-col>
    </el-row> -->
  </div>
</template>

<script>
import PanelGroup from "./dashboard2/PanelGroup.vue";
import homeApi from "@/api/home/index"
export default {
  name: "statistics",
  components:{
    PanelGroup
  },
  data() {
    return {
      suppler:[],//商家账号数量
      sellOrderList:[],//销售卖号
      subOrderList:[],//商家出号
      games:[],
      jobs:[],
    };
  },
  created(){
    this.userGameCount()
    this.sellOrder()
    this.subOrder()
    this.GameTypeCount()
    this.taskCount()
  },
  methods: {
    // 商家账号数量
    userGameCount(){
     homeApi.userGameCount().then(res=>{
        this.suppler = res.data
     })
   },
   // 销售卖号统计
   sellOrder(){
     homeApi.sellOrder().then(res=>{
      console.log("%c Line:173 🍫 res", "color:#33a5ff", res);
        // this.notices = res.rows.splice(0,4)
        this.sellOrderList = res.data
     })
   },
   // 供货商出号
   subOrder(){
     homeApi.subOrder().then(res=>{
      console.log("%c Line:173 🍫 res", "color:#33a5ff", res);
        // this.notices = res.rows.splice(0,4)
        this.subOrderList = res.data
     })
   },
  //  GameTypeCount  游戏类型统计
  GameTypeCount(){
     homeApi.GameTypeCount().then(res=>{
      console.log("%c Line:173 🍫 res", "color:#33a5ff", res);
        // this.notices = res.rows.splice(0,4)
        this.games = res.data
     })
   },
  //  taskCount  当前任务
  taskCount(){
     homeApi.taskCount().then(res=>{
      console.log("%c Line:173 🍫 res", "color:#33a5ff", res);
        // this.notices = res.rows.splice(0,4)
        this.jobs = res.data
     })
   },
  }
};
</script>

<style scoped lang="scss">
.app-container{
  min-width: 940px;
}
.update-log{
  margin-bottom: 20px;

}
.clearfix{
  font-weight: 600;
}
</style>

